<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>touch事件基本概念</title>
</head>
<style>
    *{margin: 0;padding: 0;}
    body {
        width: 100vw;
        height: 100vh;
        /* max-width: 640px;
        min-width: 320px; */
        background-color: slategrey;
        display: flex;
        justify-content: center;
        align-items: center;
        box-sizing: border-box;
        /* margin: 0 auto; */
    }
    .item-1 {
        width: 100px;
        height: 100px;
        background-color: violet;
    }
</style>
<body>
    <div class="item-1"></div>
    <script>
        const item = document.querySelector('.item-1');
        item.addEventListener('touchstart',() => {
            console.log('touchstart')
        })

        item.addEventListener('touchmove',() => {
            console.log('touchmove')
        })

        item.addEventListener('touchend',() => {
            console.log('touchend')
        })

        item.addEventListener('touchcancel',() => {
            console.log('touchcancel')
        })

        /**
         * touch事件触发元素必须得有宽高值
        */
    </script>
</body>
</html>